package org.ants.basecomponent.action.tree;

import java.util.List;

import org.ants.basecomponent.action.base.BaseAction;
import org.ants.basecomponent.pojo.tree.TreeData;
import org.ants.basecomponent.util.JSONUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.tinygroup.vfs.FileObject;


@Controller
@RequestMapping("/tree")
public class TreeAction extends BaseAction{
	
    @RequestMapping(value = "/ztreeData")
    @ResponseBody
    public List<TreeData> ztreeData(Model model) {
    	
    	FileObject fileObject = this.getFileObject("ztreeData.txt");
    	List<TreeData> treeDates = JSONUtils.getListByFileObject(fileObject.getInputStream(),TreeData.class);
        return treeDates;
    }
}
